/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package matching;

/**
 *
 * @author livia
 */
public class Matching {

    public boolean isClass;
    public  Triple source;
    public Triple target;

    public Matching(Triple source, Triple target) throws Exception {
        if((source.isClass()&& target.isClass())||
           (!source.isClass()&& !target.isClass())){
            isClass = source.isClass();
            this.source = source;
            this.target = target;
        }
        else throw new Exception("Triplas incompativeis");
    }

    public Triple getSource(){
        return source;
    }

    public Triple getTarget(){
        return target;
    }

    public boolean equals(Matching m){
        return source.equals(m.source)&&
               target.equals(m.target);
    }

    public boolean isClass(){
        return isClass;
    }
    
    public String toString(){
		return "source:"+source+"\n"+"target:"+target;
    	
    }
}
